/*
 * =====================================================================================
 *
 *       Filename:  sunday_str_search.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  11/26/2010 09:39:36 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Ken Chen (Ken), chen_kenz@emc.com
 *        Company:  EMC
 *
 * =====================================================================================
 */

#ifndef _SUNDAY_STR_SEARCH_H
#define _SUNDAY_STR_SEARCH_H

class Sunday
{
public:
  Sunday( const char* txt, const char* pattern );
  ~Sunday();
  const char* find() const;

private:
  void preprocessPatternStr( void );
  static int strnCompare( const char* s1, const char* s2, int len );

private:
  static const int ASCII_SIZE = 128;

private:
  const char* m_text;
  const char* m_pattern;
  int m_txtLength;
  int m_patLength;
  int m_steppers[ ASCII_SIZE ];
};

#endif //_SUNDAY_STR_SEARCH_H
